* Replication code for Figures 1 and 2 of "A Computational Model for Identifying Delegating and Constraining Provisions in European Union Laws"
* Fabio Franchino, Marta Migliorati, Giovanni Pagano and Valerio Vignoli
* European Union Politics

version 18
clear all
use dataset.dta
graph set window fontface "Verdana"

* Keep measures in these policy domains: Freedom of movement for workers and social policy, Right of establishment and freedom to provide services, Transport policy, Energy, Industrial policy and internal market, Environment, consumers and health protection
keep if area_code==5 | area_code==6 |area_code==7 | area_code==12 | area_code==13 | area_code==15

* Collapse by year
collapse del_nca_r con_nca_r so_nca_r (sum) no_act s_count, by(year)

*************** Figure A1: Trends in delegation and constraint of national authorities in internal market policies
line del_nca_r year, lc(black) || line so_nca_r year, lc(black) lp(longdash) || line con_nca_r year, lc(black) lp(shortdash) legend(region(c(none)) pos(0) bplace(nw) col(2)  size(small) label(1 "Delegation") label(2 "Soft obligation") label(3 "Constraint")) graphregion(fcolor(white)) xlabel(1958 (10) 2019) xtitle("") xlabel(1958 (10) 2019, nogrid labsize(3)) ylabel(, nogrid labsize(3)) title("", size(3) c(black)) saving(Figure_A1, replace)


graph export "Figure_A1.png", as(png) name("Graph") replace